#lang r5rs
(define (double f)
  (lambda (x) (f (f x))))
(define (inc x) (+ x 1))
(display ((double inc) 1))
(display (((double double) inc) 5))
(display (((double (double double)) inc) 5))